Ext.namespace("Ext.ux");
Ext.ux.WordLinkWin = Ext.extend(Ext.Window,{
	setParams:function(config){
		if(this.getComponent(0) && this.getComponent(0).setParams){
			this.getComponent(0).setParams(config);
		}
	}
})
Ext.ux.wordLinkWin = new Ext.ux.WordLinkWin({
	title:'查看文字链',
	width:200,
	height:200,
	closeAction : "hide",
	items:[{
		xtype:'linkbutton',
		href:'http://www.google.com',
		html:'google'
	}]
});

Ext.ux.FlashWinEmbed = Ext.extend(Ext.Window,{
	curThis:null,
	setParams:function(config){
		if(this.getComponent(0) && this.getComponent(0).setParams){
			this.getComponent(0).setParams(config);
		}
		this.setSize(config.width,config.height);
	},
	doResize:function(){
		var curObj = this;
		var obj = curObj.getComponent(0).iframeAutoSize();
		curObj.setSize(obj.width+curObj.getFrameWidth(),obj.height+curObj.getFrameHeight());
	},
	onRender : function(ct, position){
        Ext.ux.FlashWinEmbed.superclass.onRender.call(this, ct, position);
	},
	initComponent : function(){
        Ext.ux.FlashWinEmbed.superclass.initComponent.call(this);
        this.on("afterrender",this.checkLoadCompany);
	},
	checkLoadCompany:function(){
		var len = this.getSize();
		this.setSize(len.width+this.getFrameWidth(),len.height);
	}
	
})
Ext.ux.flashWin = new Ext.ux.FlashWinEmbed({
	title:'查看flash',
	width:200,
	height:200,
	closeAction : "hide",
	items:[{
		xtype:'embed',
		src:''
	}]
});

Ext.ux.iframWin = Ext.extend(Ext.Window,{
	curThis:null,
	setParams:function(config){
		if(this.getComponent(0) && this.getComponent(0).setParams){
			this.getComponent(0).setParams(config);
		}
	},
	doResize:function(){
		var curObj = this;
		//setTimeout(this.tempFn,1500);
		var obj = curObj.getComponent(0).iframeAutoSize();
		curObj.setSize(obj.width+curObj.getFrameWidth(),obj.height+curObj.getFrameHeight());
	},
	onRender : function(ct, position){
        Ext.ux.iframWin.superclass.onRender.call(this, ct, position);
		this.fireEvent("show");
	},
	initComponent : function(){
        Ext.ux.iframWin.superclass.initComponent.call(this);
        this.on("afterrender",this.checkLoadCompany);
	},
	checkLoadCompany:function(){
		var obj = this.getComponent(0).onloadAutoSize(this);
	}
	
})
Ext.ux.iframeWin = new Ext.ux.iframWin({
	title:'查看flash',
	width:200,
	height:200,
	closeAction : "hide",
	items:[{
		xtype:'iframe',
		src:''
	}]
});